package com.ty.model.${src};

<#list importList as im>
import ${im};
</#list>

public class ${entity} implements Serializable ${r'{'}
	/**
	 * serialVersionUID :
	 */
	private static final long serialVersionUID = -1L;

	<#list colList as c>
	private ${c.javaType} ${c.property};
	
	</#list>
	<#list colList as c>
	public ${c.javaType} get${c.property?cap_first}() ${r'{'}
		return ${c.property};
	${r'}'}

	public void set${c.property?cap_first}(${c.javaType} ${c.property}) ${r'{'}
		<#if c.javaType == 'String'>
		this.${c.property} = ${c.property} == null ? null : ${c.property}.trim();
		<#else>
		this.${c.property} = ${c.property};
		</#if>
	${r'}'}
	<#if c_index != colList?size -1 >
	
	</#if>
	</#list>
	
	@Override
	public int hashCode() ${r'{'}
		final int prime = 31;
		int result = 1;
		<#list colList as c>
		<#if c.javaType == 'Byte[]'>
		result = prime * result + Arrays.hashCode(${c.property});
		<#else>
		result = prime * result + ((${c.property} == null) ${r'?'} 0 : ${c.property}.hashCode());
		</#if>
		</#list>
		return result;
	${r'}'}

	@Override
	public boolean equals(Object obj) ${r'{'}
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		${entity} other = (${entity}) obj;
		<#list colList as c>
		if (${c.property} == null) ${r'{'}
			if (other.${c.property} != null)
				return false;
		${r'}'} else if (!${c.property}.equals(other.${c.property}))
			return false;
		</#list>
		return true;
	${r'}'}

	@Override
	public String toString() ${r'{'}
		return "${entity} ["
			<#list colList as c>
			+"<#if c_index != 0>, </#if>${c.property}=" + <#if c.javaType == 'Byte[]'>Arrays.toString(${c.property})<#else>${c.property}</#if>
			</#list>
			+ "]";
	${r'}'}
${r'}'}